GBML manual / Backgrounds

floor_scale_at

How big something at the floor place (x, y) looks: 1 is its real size on the picture, smaller the farther away. 0 when the place is behind the camera or past the horizon.

Game Boy: not available

Game Boy Color: not available

Sega Genesis: not built yet

On other consoles this differs: see Side by side and How the consoles differ.

Syntax

floor_scale_at(x, y) -> real

Arguments

NameType
xreal
yreal

Returns

real

Description

How big something at the floor place (x, y) looks: 1 is its real size on the picture, 0.5 half of it, smaller the farther away. It is 0 when the place is behind the camera or past the horizon.

It is perspective_floor_project and perspective_floor_scale in one call, and the one to use for choosing a size step (draw_sprite_on_floor) or for skipping what is too small to matter.

Example

// Draw event: hide a rival that is too far to see.
if (floor_scale_at(x, y) < 0.15) { visible = false; }

Instances more than about seven times farther than their real size stop being drawn.

On the GBA

The one call for choosing a size step (see draw_sprite_on_floor) or for skipping what is too small to matter. It is perspective_floor_project and perspective_floor_scale in one.

See also: Perspective floordraw_sprite_on_floorperspective_floor_projectperspective_floor_scale